<?php

class Form_AdminKlacht extends Zend_Form
{
	public function __construct($userGroup = "Gebruiker")
	{
		parent::__construct();
		$this->setAction('/klacht/add')
           ->setMethod('post');
		
		
        $this->addElement('hidden','klachtEigenaar');
		
        $this->addElement('text','klachtTitel', array(
			'label' => 'Titel'
			
		));
		
		$this->addElement('textarea','klachtBody', array(
			'label' => 'Klacht',
			'style' => 'width: 600px; height: 200px;',
		));
				
		$statusSelect = new Zend_Form_Element_Select('klachtStatus');
        $statusSelect->setLabel('Status')
              		->setMultiOptions(array('1'=>'Open', '2'=>'Processing', '3' => 'Closed'))
              		->setRequired(true)->addValidator('NotEmpty', true);
		$this->addElement($statusSelect);
		
		$prioSelect = new Zend_Form_Element_Select('klachtPrio');
        $prioSelect->setLabel('Prioriteit')
              		->setMultiOptions(array('1'=>'1', '2'=>'2', '3' => '3'))
              		->setRequired(true)->addValidator('NotEmpty', true);
		$this->addElement($prioSelect);
		
		//behandelaars ophalen uit de database (alleen gebruikers die usertype medewerker hebben)
		$userModel = new Model_DbTable_User();
		$behandelaars = $userModel->getBehandelaars();
		
		$configSelect = new Zend_Form_Element_Select('klachtBehandelaar');
        $configSelect->setLabel('Behandelaar')
              		->setMultiOptions($behandelaars)
              		->setRequired(true)->addValidator('NotEmpty', true);
		$this->addElement($configSelect);
		
		$configModel = new Model_DbTable_Configuration();
		$configs = $configModel->getConfigurations();
		
		$configSelect = new Zend_Form_Element_Select('klachtConfig');
        $configSelect->setLabel('Configuratie')
              		->setMultiOptions($configs)
              		->setRequired(true)->addValidator('NotEmpty', true);
		$this->addElement($configSelect);
		
		$typeSelect = new Zend_Form_Element_Select('klachtType');
        $typeSelect->setLabel('Type klacht')
              		->setMultiOptions(array('1'=>'Hardware', '2'=>'Software', '3'=>'Other'))
              		->setRequired(true)->addValidator('NotEmpty', true);
		$this->addElement($typeSelect);
		
		$this->addElement('text','klachtTijdsduur', array(
			'label' => 'Tijdsduur'
			
		));
		$this->addElement('text','klachtOplosDatum', array(
			'label' => 'Verwachte oplos datum',
			
		));
		
		$this->addElement('textarea','klachtOplossing', array(
			'label' => 'Oplossing',
			'style' => 'width: 600px; height: 100px;',
		));
		
		
		$this->addElement('submit','submit', array(
			'ignore' => true
		));
		
				
	}
		
	
}

